package com.aaa.service.impl;

import com.aaa.dao.TestResultSasDao;
import com.aaa.service.TestResultSasService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TestResultSasServiceImpl implements TestResultSasService {
    @Autowired
    private TestResultSasDao testResultSasDao;


    /**
     * 将用户测试答案放入数据库中
     * @param list
     * @return
     */
    @Override
    public boolean insertTestSas(List<Map> list) {
        Integer i=null;
        for(Map<String,Object> map:list){
            i=testResultSasDao.insertTestSas(map);
        }
        if(i>0&&i!=null){
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteTestResultSasByID(Integer id) {
        int deleteTestResultSasByID = testResultSasDao.deleteTestResultSasByID(id);
        if (deleteTestResultSasByID>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteTestResultSasBatch(String id) {
        int deleteTestResultSasBatch = testResultSasDao.deleteTestResultSasBatch(id);
        if (deleteTestResultSasBatch>0){
            return true;
        }
        return false;
    }
}
